﻿Module Module1
    Dim nickname As String
    Sub Main()
        Console.Clear()
        Console.ForegroundColor = ConsoleColor.White
        Console.Write("                     -------------------------------" & vbCrLf)
        Console.Write("                     |       CyberTek BETA 1.0     |" & vbCrLf)
        Console.Write("                     |         By Ice_Dragon       |" & vbCrLf)
        Console.Write("                     | Darkcode.me | Hackhound.org |" & vbCrLf)
        Console.Write("                     -------------------------------" & vbCrLf & vbCrLf & vbCrLf)

        Console.Write("Please choose one of the following options; (1-4)" & vbCrLf & vbCrLf)
        Console.Write("1) Begin CyberTek" & vbCrLf)
        Console.Write("2) Settings" & vbCrLf)
        Console.Write("3) About" & vbCrLf)
        Console.Write("4) High Scores" & vbCrLf)
        Console.Write("5) Exit" & vbCrLf & vbCrLf)

        choice()

    End Sub

    Function choice()

        Dim OptAns As String

        Console.Write("Input: ")

        OptAns = Console.ReadLine()

        Select Case (OptAns)

            Case "1"
                Console.Clear()
                prestartgame()

            Case "2"
                Console.Clear()
                Console.Write("Game settings will go here, allowing the user to" & vbCrLf & "change and view current settings" & vbCrLf)
                Console.ReadLine()

            Case "3"
                Console.Clear()
                Console.Write("Shoutouts, credits + greets etc can go here.." & vbCrLf)
                Console.ReadLine()

            Case "4"
                Console.Clear()
                Console.Write("Highscores etc here" & vbCrLf)
                Console.ReadLine()

            Case "5"
                End

            Case Else
                Console.Write(vbCrLf & "Error, please choose one of the above options" & vbCrLf)
                choice()

        End Select
        Main()
        Return 0
    End Function

    Sub prestartgame()
        Console.Write("Before we go on you need to set up your profile." & vbCrLf)
        Console.Write("Please insert your Alias." & vbCrLf)
        Console.Write("> ")
        nickname = Console.ReadLine()
        Console.Clear()
        Console.Write("Thank you, " & nickname & "." & vbCrLf)
        Console.ForegroundColor = ConsoleColor.Green
        Console.Write("Welcome to the CyberTek challenge." & vbCrLf & vbCrLf)
        startgame()
    End Sub


    Sub startgame()

        Console.ForegroundColor = ConsoleColor.White

        Console.Write("Enter ")
        Console.ForegroundColor = ConsoleColor.Cyan
        Console.Write("Mail")
        Console.ForegroundColor = ConsoleColor.White
        Console.Write(" to check your emails." & vbCrLf)

        Console.Write("Enter ")
        Console.ForegroundColor = ConsoleColor.Cyan
        Console.Write("Help ")
        Console.ForegroundColor = ConsoleColor.White
        Console.Write("for a list of commands" & vbCrLf & vbCrLf)

        getmenucmd()

    End Sub



    Function getmenucmd()

        Dim command As String

        Console.Write("Home > ")

        command = Console.ReadLine
        command = command.ToLower()
        Select Case (command)

            Case "mail"
                mailbox()

            Case "help"
                Console.WriteLine("help info etc here" & vbCrLf)

            Case "exit"
                Console.Write("Are you sure you want to exit? Y/N" & vbCrLf)
                Console.Write("> ")
                command = Console.ReadLine()

                If command = "y" Then

                    Main()

                Else
                    getmenucmd()

                End If

            Case Else
                Console.WriteLine("Error, command not supported." & vbCrLf)


        End Select

        getmenucmd()

        Return 0

    End Function



    Function mailbox()

        Dim mailcmd As String
        Console.Clear()
        Console.ForegroundColor = ConsoleColor.Green
        Console.Write("--- Welcome to CyberMail 1.0 ---" & vbCrLf & vbCrLf)
        Console.ForegroundColor = ConsoleColor.White
        Console.Write("Please Select From The Following Options:" & vbCrLf & vbCrLf)
        Console.Write("1) Inbox" & vbCrLf)
        Console.Write("2) New Mail" & vbCrLf)
        Console.Write("3) Exit" & vbCrLf & vbCrLf & vbCrLf)

        Console.Write("Mail > ")
        mailcmd = Console.ReadLine()

        Select Case (mailcmd)
            Case "1"
                ' A Max of 100 mails is good I think.
                Dim MailSubject(100) As String
                Dim MailContent(100) As String
                MailSubject(1) = "1) " & "Welcome to CyberTek"
                MailSubject(2) = "2) " & "Hints and Tips"
                'Subject Ends, Content Begins

                MailContent(1) = "CyberTek is a console based Hacking simulation, developed in VB.NET. The intention of the game is to dramatically decrease the difference between playing Hacking games, and the real thing. CyberTek intends to bring a new realistic game to the table, giving users first hand experience to the world of Computer Hacking."
                MailContent(2) = "To Be Implemented"
                'Console.Write(MailArray(1) & vbCrLf)
                'Console.Write(MailArray(2) & vbCrLf)                
                For x = 0 To 100
                    If MailSubject(x) Is Nothing Then
                        ' Nothing to be printed :)
                    Else
                        Console.Write(MailSubject(x) & vbCrLf)
                    End If
                Next x

                Console.Write("Please enter a number of a mail to read: " & vbCrLf)
                Console.Write("Mail > ")
                Dim y As Integer
                y = Console.ReadLine()
                If y <= 100 Then
                    Console.Write(MailContent(y) & vbCrLf)
                Else
                    Console.Write("Invalid Mail Number" & vbCrLf)
                End If


                'Console.Write("Inbox:" & vbCrLf & vbCrLf)
                'Console.Write("Please Select The Email To Read;" & vbCrLf)
                'Console.ForegroundColor = ConsoleColor.Green
                'Console.Write("[New Message #1]")
                'Console.ForegroundColor = ConsoleColor.White
                'Console.Write(" Subject: Welcome to CyberTek" & vbCrLf)
                'Console.ForegroundColor = ConsoleColor.Green
                'Console.Write("[New Message #2]")
                'Console.ForegroundColor = ConsoleColor.White
                'Console.Write(" Subject: Hints and Tips" & vbCrLf)

            Case "2"
                Console.ForegroundColor = ConsoleColor.Green
                Console.Write("Create Mail:" & vbCrLf & vbCrLf)
                Console.ForegroundColor = ConsoleColor.White
                Console.Write("Reciepient Address: ")
                Console.ReadLine()
                Console.Write("Subject: ")
                Console.ReadLine()
                Console.Write("Message: ")
                Console.ReadLine()
                Console.Write(vbCrLf)
                Console.Write("...Mail Sucessfully Sent!" & vbCrLf)

                mailbox()

            Case "3"
                Console.Clear()
                startgame()


            Case Else
                Console.Write("Please Enter a Valid Command." & vbCrLf)
                Console.Clear()
                mailbox()
        End Select

        Return 0
    End Function

End Module

